<template>
  <div class="">
    <analysis-do-main-log-table
      :list="logList"
      :pageData="pageData"
      :loading="tableLoading"
      @pageChange="pageChange"
      @pageSizeChange="pageSizeChange"
    ></analysis-do-main-log-table>
  </div>
</template>
<script>
import { domainResolutionLogPageList } from "@/api/bidding";
import analysisDoMainLogTable from "_c/table/analysisDoMainLogTable";
export default {
  components: {
    analysisDoMainLogTable,
  },
  data() {
    return {
      // 域名解析列表
      logList: [],
      pageData: {
        // 域名总数
        total: 0,
        // 页码
        page: 1,
        // 分页调试
        limit: 10,
      },
      tableLoading: false,
    };
  },
  methods: {
    async getDomainResolutionLogPageList() {
      this.params.domainId = this.domainId;
      this.params.page = this.pageData.page;
      this.params.limit = this.pageData.limit;
      this.tableLoading = true;
      const { code, data } = await domainResolutionLogPageList(this.params);
      this.tableLoading = false;
      if (code === 200 && data) {
        this.logList = data.list;
        this.pageData.total = data.total;
      }
    },
    pageChange(val) {
      this.pageData.page = val;
      this.getDomainResolutionLogPageList();
    },
    pageSizeChange(val) {
      this.pageData.page = 1;
      this.pageData.limit = val;
      this.getDomainResolutionLogPageList();
    },
  },
  created() {},
  mounted() {
    this.domainId = this.$route.params.domainId;
    this.params = {};
    this.getDomainResolutionLogPageList();
  },
};
</script>
<style lang="scss" scoped></style>
